package com.sky.mapper;



import com.sky.dto.ShoppingCartDTO;
import com.sky.entity.ShoppingCart;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface ShoppingCartMapper {
    /**
     * 查询购物车
     * @param shoppingCart
     * @return
     */
    List<ShoppingCart> getCartBy(ShoppingCart shoppingCart);

    /**
     * 添加商品到购物车
     * @param shoppingCart
     */
    void addShoppingCart(ShoppingCart shoppingCart);

    /**
     * 更新购物车
     * 对购物车里的商品进行增加
     * @param shoppingCart
     */
    void updateShoppingCart(ShoppingCart shoppingCart);

    /**
     * 清空购物车
     * 对购物车的商品减少一个
     */
    void clean(ShoppingCart shoppingCart);


    void addShoppingCartById(ShoppingCart shoppingCart);
}
